//package com.example.a20112.ui_demo.adapter;
//
//import android.content.Context;
//import android.support.annotation.NonNull;
//import android.support.v7.widget.RecyclerView;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.ImageView;
//import android.widget.RatingBar;
//import android.widget.TextView;
//import android.widget.Toast;
//
//import com.example.a20112.ui_demo.R;
//import com.example.a20112.ui_demo.beans.FoodListBean;
//import com.example.a20112.ui_demo.model.Constants;
//import com.squareup.picasso.Picasso;
//
//import java.util.List;
//
//public class FoodListAdapter extends RecyclerView.Adapter<FoodListAdapter.ViewHolder> {
//    private Context mContext;
//    private List<FoodListBean> mDataList;
//    private LayoutInflater mLayoutInflater;
//    public FoodListAdapter(Context mContext, List mDataList, int item_foodlist, TextView phonenum){
//        this.mContext=mContext;
//        this.mDataList=mDataList;
//        mLayoutInflater=LayoutInflater.from(mContext);
//    }
//
//    @NonNull
//    @Override
//    public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
//        View view = mLayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_foodlist, viewGroup,false);
//        return new ViewHolder(view);
//    }
//
//    @Override
//    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
//        final FoodListBean entity=(FoodListBean)mDataList.get(position);
//        if(null==entity)
//            return;
//        ViewHolder viewHolder=(ViewHolder)holder;
//        viewHolder.fo_name.setText(entity.getFoodname());
//        viewHolder.fo_price.setText(entity.getPrice()+"");
//        Picasso.get()
//                .load(Constants.BASE_URL+entity.getPic())
//                .into(viewHolder.fo_image);
//        viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                Toast.makeText(mContext,entity.getFoodname(),Toast.LENGTH_LONG).show();
//
//            }
//        });
//
//    }
//
//    @Override
//    public int getItemCount() {
//        return 0;
//    }
//
//    public class ViewHolder extends RecyclerView.ViewHolder {
//        TextView fo_name,fo_price,phonenum;
//        ImageView fo_image;
//        RatingBar res_bar;
//        public ViewHolder(View view) {
//            super(view);
//            fo_name = (TextView) view.findViewById(R.id.fo_name);
//            fo_price = (TextView) view.findViewById(R.id.fo_price);
//            fo_image = (ImageView) view.findViewById(R.id.fo_image);
//            phonenum=(TextView) view.findViewById(R.id.phonenum);
//        }
//    }
//}
